package com.ssyt.yec.common.util;

import java.util.ResourceBundle;

import org.apache.commons.lang3.Validate;

import com.ssyt.yec.common.Constant;

public class AppUtil {

	private static final String DEFAULT_PROPERTIES_NAME = "jdbc";

	/**
	 * 空构造方法
	 */
	private AppUtil() {
	}

	/**
	 * 读取properties文件的内容
	 * 
	 * @param key
	 * @return
	 */
	public static String getDefaultBundle(String key) {
		return getBundle(DEFAULT_PROPERTIES_NAME, key);
	}

	public static String getBundle(String properitesName, String key) {
		Validate.notBlank(properitesName, "properitesName" + Constant.VALIDATE_NOT_BLANK);
		Validate.notBlank(key, "key" + Constant.VALIDATE_NOT_BLANK);

		return ResourceBundle.getBundle(properitesName).getString(key);
	}

}
